package com.syscom.server.qd.vo;

import java.util.Hashtable;
import java.util.Map;

import com.syscom.frmcommon.util.ArithUtil;

public class ConfigRatio {
	private String sServerId = null;
	private double dServerRatio = 0;
	private Map<Integer, Double> map = new Hashtable<Integer, Double>();
	
	public void setServerId(String sServerId) {
		this.sServerId = sServerId;
	}
	
	public String getServerId() {
		return sServerId;
	}
	
	public void setServerRatio(int iServerRatio) {
		this.dServerRatio = ArithUtil.div(iServerRatio, 100);
	}
	
	public double getServerRatio() {
		return dServerRatio;
	}
	
	public void setRuleRatio(int iRuleId, int iRatio) {
		double dRatio = ArithUtil.div(iRatio, 100);
		map.put(iRuleId, dRatio);
	}
	
	public double getRuleRatio(int iRuleId) {
		if(map.containsKey(iRuleId)) {
			return map.get(iRuleId);
		}
		return 0;
	}
}
